﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VirtualBank
{
    internal class Bank
    {
        private List<Account> accounts = new List<Account>();//存储银行内部账号
        public int Id { get; private set; }
        public String Name { get; private set; }
        public String Description { get; private set; }

        Bank(List<Account> accounts, int id, string name, string description)
        {
            this.accounts = accounts;
            Id = id;
            Name = name;
            Description = description;
        }

        public Bank() { }

        //新增银行账户
        public void AddAccount(Account account)
        {
            accounts.Add(account);
        }

        //根据ID查找账户
        public Account GetAccount(int accountNumber)
        {
            return accounts.Find(a => a.Id == accountNumber);
        }

    }
}
